﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace JZElectrick {
    public partial class MsgForm : Form {
        public MsgForm() {
            InitializeComponent();
        }

        string msg = null;


        public MsgForm(string msg) : this() {
            this.msg = msg;
        }

        public delegate void MsgFormResultDelegate(bool flag);
        public MsgFormResultDelegate MsgFormResultEvent;

        private void MsgForm_Load(object sender, EventArgs e) {
            if (msg != null) {
                msgLabel.Text = msg;
            }
        }

        private void msgForm_FormClosed(object sender, FormClosedEventArgs e) {
            MsgFormResultEvent(false);
        }

        private void retryBtn_Click(object sender, EventArgs e) {
            MsgFormResultEvent(true);
        }

        private void quitBtn_Click(object sender, EventArgs e) {
            MsgFormResultEvent(false);
        }

        
    }
}
